package com.example.seckill.service;

import com.example.seckill.dto.Exposer;
import com.example.seckill.dto.SeckillExecution;
import com.example.seckill.entity.Seckill;
import com.example.seckill.exception.RepeatKillException;
import com.example.seckill.exception.SeckillCloseException;
import com.example.seckill.exception.SeckillException;

import java.util.List;

public interface SeckillService {

    /**
     * 查询所有秒杀记录
     * @return
     */
    List<Seckill> querySeckillList();

    /**
     * 获取单个秒杀记录
     * @param id
     * @return
     */
    Seckill getById(long id);

    /**
     * 输出秒杀接口地址，秒杀开启时输出，
     * 否则输出系统时间和秒杀时间
     * @param seckillId
     */
    Exposer exportSeckillUrl(long seckillId);


    SeckillExecution executeSeckill(long seckillId, String userPhone, String md5)
            throws SeckillException,RepeatKillException,SeckillCloseException;
}
